﻿<phone:PhoneApplicationPage xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"  
    xmlns:mh="clr-namespace:MikeHole.TileMaker;assembly=MikeHole.TileMaker"  
    x:Class="MikeHole.TileMaker.TestApp.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:c4fToolkit="clr-namespace:Coding4Fun.Phone.Controls;assembly=Coding4Fun.Phone.Controls"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="696"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <UserControl.Resources>
        <DataTemplate x:Key="ImagesItemTemplate">
            <Grid >
                <Image Source="{Binding}" Width="70" Height="70" Margin="2" />
            </Grid>
        </DataTemplate>
        <ItemsPanelTemplate x:Key="ImagesItemsPanel">
            <toolkit:WrapPanel/>
        </ItemsPanelTemplate>
    </UserControl.Resources>


    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock Text="Tile Maker Test Application" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock Text="Test Page" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition Height="70"/>
            </Grid.RowDefinitions>

            <mh:TileMakerControl Grid.Row="0" x:Name="maker" />

            <ListBox Grid.Row="1" x:Name="lstImages" ItemTemplate="{StaticResource ImagesItemTemplate}" ItemsPanel="{StaticResource ImagesItemsPanel}" />

            
            
        </Grid>
    </Grid>
 
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar.feature.camera.rest.png" Text="Load" x:Name="cmdLoad" Click="cmdLoad_Click" />
            <shell:ApplicationBarIconButton IconUri="/Images/appbar.save.rest.png" Text="Save" x:Name="cmdSave" Click="cmdSave_Click"/>
            <shell:ApplicationBarIconButton IconUri="/Images/paintbrush.png" Text="Back Color" x:Name="cmdPickColor" Click="cmdPickColor_Click" />
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>